﻿using System;

using Fuse8.DomainFramework.Common;
using Fuse8.DomainFramework.Common.Locator;

using Fuse8.ContentManagementFramework.Domain;
using Fuse8.ContentManagementFramework.Domain.Bases;

namespace Fuse8.ContentManagementFramework.BizFacade
{
    public static class AdministrationAreaMediator
    {
        public static ICmsContext ApplicationContext
        {
            get
            {
                return DependencyServiceLocator.Current.GetInstance<ICmsContext>();
            }
        }

        public static void SetAreaFlag(IManagedEntityObject entity)
        {
            if (entity != null)
            {
                entity.IsInAdministrationArea = ApplicationContext.IsInAdministrationArea;
            }
        }
    }
}
